{% extends "./base.html" %}
{% block title %}
<title>快约面试</title>
{% endblock %}
{% block style %}
<link rel="stylesheet" href="/css/home.css">
{% endblock %}
{% block content %}
<div class="wrap job_bg">


  <div class="head">
    <div class="title">{{info.name}}</div>
    <div class="des">热招岗位·免费在线AI面试分析</div>
  </div>

  <div class="infoItem">
    <div class="title">
      <img src="/images/ic—3@2x.png" alt="">
    </div>
    <div class="tags num">
      {{info.money_start}}-{{info.money_end}}元
    </div>
  </div>

  <div class="infoItem">
    <div class="title">
      <img src="/images/ic—2@2x.png" alt="">
    </div>
    <div class="tags">
      {{info.company_name}}
    </div>
  </div>

  <div class="infoItem">
    <div class="title">
      <img src="/images/ic—1@2x.png" alt="">
    </div>
    <div class="tags">
      {%for val in info.tags %}{{val.name}}{% if loop.index != info.tags.length %}、{% endif %}{% endfor %}
    </div>
  </div>

  <div class="bottom">
    <div class="title">免费AI面试</div>
    <div class="des">点击预约AI面试，完成面试后可获得面试分析报告助力您的求职</div>
    <span class="label">您的电话</span>
    <input type="text" placeholder="输入手机号" id="phoneNumber" maxlength="11">
    <div class="btn" onClick="enterPlugin({{openlink}})">
      开始面试
    </div>
  </div>

  <script>
    window.onload = function () {
      // document.getElementById('content').innerHTML = decodeURI('{{info.desc}}')
    }

    function enterPlugin(TICKET) {
      const val = document.getElementById('phoneNumber').value
      if (!val) {
        alert('请输入合法的手机号')
        return
      }
      var isPhone = /^0\d{2,3}-?\d{7,8}$/
      if (val.length !== 11 || isPhone.test(val)) {
        alert('请输入合法的手机号')
        return
      }

      $.get("/index/company/submit", {
        phone: val,
        company: '{{company}}',
        id: '{{id}}'
      }, function (result) {
        if (result.data.openlink) {
          location.href = result.data.openlink
        } else {
          alert('请联系管理员')
        }
      });
    }
  </script>

  {% endblock %}